package com.servlet.service.impl;

import java.sql.SQLException;

import com.servlet.dao.AccountDao;
import com.servlet.service.IAccountService;
import com.servlet.vo.bean.Account;

public class AccountServiceImpl implements IAccountService{
	
	private AccountDao accountDao;
	private boolean flag = false;
	
	public AccountServiceImpl() throws SQLException{
		accountDao = new AccountDao();
	}
	
	/**
	 * @param id 账户id
	 * @return  查询未删除账户，有则返回账户实体，无则返回null
	 */
	public Account getObjById(Long id) {
		return accountDao.getObj(id);
	}

	/**
	 * 更新 账户可用余额
	 */
	public boolean refreshAvailableBalance(Account obj) {
		return accountDao.update(obj, false);
	}
	
	
}
